package com.topgay.domain;

import java.io.Serializable;


public class Message implements Serializable{
	private int num;
	private String fromId;
	private String toId;
	private String content;
	
	//date는 어떤 타입으로 해야하는 거지??
	private String days;
	private String title;
	private int flag;
	
	public Message(){}
	
	
	
	
	public Message(int num, String fromId, String toId, String content,
			String days, String title) {
		super();
		this.num = num;
		this.fromId = fromId;
		this.toId = toId;
		this.content = content;
		this.days = days;
		this.title = title;
	}




	public Message(String fromId, String toId, String content,
			String days, String title) {
		super();
		this.fromId = fromId;
		this.toId = toId;
		this.content = content;
		this.days = days;
		this.title = title;
	}

	public int getNum() {
		return num;
	}

	public void setNum(int num) {
		this.num = num;
	}

	public String getFromId() {
		return fromId;
	}

	public void setFromId(String fromId) {
		this.fromId = fromId;
	}

	public String getToId() {
		return toId;
	}

	public void setToId(String toId) {
		this.toId = toId;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getDays() {
		return days;
	}

	public void setDays(String days) {
		this.days = days;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getFlag() {
		return flag;
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((content == null) ? 0 : content.hashCode());
		result = prime * result + ((days == null) ? 0 : days.hashCode());
		result = prime * result + flag;
		result = prime * result + ((fromId == null) ? 0 : fromId.hashCode());
		result = prime * result + num;
		result = prime * result + ((title == null) ? 0 : title.hashCode());
		result = prime * result + ((toId == null) ? 0 : toId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Message other = (Message) obj;
		if (content == null) {
			if (other.content != null)
				return false;
		} else if (!content.equals(other.content))
			return false;
		if (days == null) {
			if (other.days != null)
				return false;
		} else if (!days.equals(other.days))
			return false;
		if (flag != other.flag)
			return false;
		if (fromId == null) {
			if (other.fromId != null)
				return false;
		} else if (!fromId.equals(other.fromId))
			return false;
		if (num != other.num)
			return false;
		if (title == null) {
			if (other.title != null)
				return false;
		} else if (!title.equals(other.title))
			return false;
		if (toId == null) {
			if (other.toId != null)
				return false;
		} else if (!toId.equals(other.toId))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Message [num=" + num + ", fromId=" + fromId + ", toId="
				+ toId + ", content=" + content + ", days=" + days + ", title="
				+ title + ", flag=" + flag + "]";
	}
	
	
	
}
